<!--
Copyright (c) 2019-2026, Hossein Moein
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
  notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
  notice, this list of conditions and the following disclaimer in the
  documentation and/or other materials provided with the distribution.
* Neither the name of Hossein Moein and/or the DataFrame nor the
  names of its contributors may be used to endorse or promote products
  derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL Hossein Moein BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-->
<!DOCTYPE html>
<html>

<head>
<style>
body {
  background-image: linear-gradient(Azure, AliceBlue, GhostWhite, WhiteSmoke);
}
</style>
</head>

<body style="font-family: Georgia, serif">

  <font size="+3">&#8592;</font> <a href="https://hosseinmoein.github.io/DataFrame/docs/HTML/DataFrame.html">Back to Documentations</a><BR><BR>
  
  <table border="1">

    <tr bgcolor="lightblue">
      <th>Signature</th> <th>Description</th>
    </tr>
    <tr bgcolor="Azure">
      <td>
<pre class="code_syntax" style="color:#000000;background:#ffffff00;"><span class="line_wrapper"><span style="color:#800000; font-weight:bold; ">enum</span> <span style="color:#800000; font-weight:bold; ">class</span> exponential_decay_spec <span style="color:#800080; ">:</span> <span style="color:#800000; font-weight:bold; ">unsigned</span> <span style="color:#800000; font-weight:bold; ">char</span>  <span style="color:#800080; ">{</span></span>
<span class="line_wrapper">    center_of_gravity <span style="color:#808030; ">=</span> <span style="color:#008c00; ">1</span><span style="color:#808030; ">,</span> <span style="color:#696969; ">// Decay = 1 / (1 + α)     For α &gt;= 0</span></span>
<span class="line_wrapper">    span <span style="color:#808030; ">=</span> <span style="color:#008c00; ">2</span><span style="color:#808030; ">,</span>              <span style="color:#696969; ">// Decay = 2 / (1 + α)     For α &gt;= 1</span></span>
<span class="line_wrapper">    halflife <span style="color:#808030; ">=</span> <span style="color:#008c00; ">3</span><span style="color:#808030; ">,</span>          <span style="color:#696969; ">// Decay = 1 - e<sup>log(0.5)/α</sup>   For α &gt; 0</span></span>
<span class="line_wrapper">    fixed <span style="color:#808030; ">=</span> <span style="color:#008c00; ">4</span><span style="color:#808030; ">,</span>             <span style="color:#696969; ">// Decay = α               For 0 &lt; α &lt;= 1</span></span>
<span class="line_wrapper"><span style="color:#800080; ">}</span><span style="color:#800080; ">;</span></span>
<span class="line_wrapper"></span></pre>
      </td>
      <td>
        This spec determines how an exponentially moving stat decays. Based on this spec, the value (&alpha;) parameter is converted to decay.
      </td>
    </tr>

  </table>

  <BR>

  <table border="1">

    <tr bgcolor="lightblue">
      <th>Signature</th> <th>Description</th> <th>Parameters</th>
    </tr>
    <tr bgcolor="Azure">
      <td>
<pre class="code_syntax" style="color:#000000;background:#ffffff00;"><span class="line_wrapper"><span style="color:#004a43; ">#</span><span style="color:#004a43; ">include </span><span style="color:#800000; ">&lt;</span><span style="color:#40015a; ">DataFrame/DataFrameStatsVisitors.h</span><span style="color:#800000; ">&gt;</span></span>
<span class="line_wrapper"></span>
<span class="line_wrapper"><span style="color:#800000; font-weight:bold; ">template</span><span style="color:#800080; ">&lt;</span><span style="color:#800000; font-weight:bold; ">typename</span> T<span style="color:#808030; ">,</span> <span style="color:#800000; font-weight:bold; ">typename</span> I <span style="color:#808030; ">=</span> <span style="color:#800000; font-weight:bold; ">unsigned</span> <span style="color:#800000; font-weight:bold; ">long</span><span style="color:#808030; ">,</span></span>
<span class="line_wrapper">         <span style="color:#666616; ">std</span><span style="color:#800080; ">::</span><span style="color:#603000; ">size_t</span> A <span style="color:#808030; ">=</span> <span style="color:#008c00; ">0</span><span style="color:#800080; ">&gt;</span></span>
<span class="line_wrapper"><span style="color:#800000; font-weight:bold; ">struct</span> ExponentiallyWeightedMeanVisitor<span style="color:#800080; ">;</span></span>
<span class="line_wrapper"></span>
<span class="line_wrapper"><span style="color:#696969; ">// -------------------------------------</span></span>
<span class="line_wrapper"></span>
<span class="line_wrapper"><span style="color:#800000; font-weight:bold; ">template</span><span style="color:#800080; ">&lt;</span><span style="color:#800000; font-weight:bold; ">typename</span> T<span style="color:#808030; ">,</span> <span style="color:#800000; font-weight:bold; ">typename</span> I <span style="color:#808030; ">=</span> <span style="color:#800000; font-weight:bold; ">unsigned</span> <span style="color:#800000; font-weight:bold; ">long</span><span style="color:#808030; ">,</span></span>
<span class="line_wrapper">         <span style="color:#666616; ">std</span><span style="color:#800080; ">::</span><span style="color:#603000; ">size_t</span> A <span style="color:#808030; ">=</span> <span style="color:#008c00; ">0</span><span style="color:#800080; ">&gt;</span></span>
<span class="line_wrapper"><span style="color:#800000; font-weight:bold; ">using</span> ewm_v <span style="color:#808030; ">=</span> ExponentiallyWeightedMeanVisitor<span style="color:#800080; ">&lt;</span>T<span style="color:#808030; ">,</span> I<span style="color:#808030; ">,</span> A<span style="color:#800080; ">&gt;</span><span style="color:#800080; ">;</span></span>
<span class="line_wrapper"></span></pre>
      </td>
      <td>
        This is a "single action visitor", meaning it is passed the whole data vector in one call and you must use the single_act_visit() interface.<BR><BR>

        This visitor calculates exponentially weighted mean (EWM). EWM gives more weight to recent data by using a decay factor.<BR>
        Formula if finite_adjust is false (default):<BR>
		<I><PRE>
    Y<SUB>t</SUB> = decay * X<sub>t</sub> + (1 − decay) * Y<sub>t-1</sub>
		</PRE></I>
        Formula if finite_adjust is true:<BR>
		<I><PRE>
          X<SUB>t</SUB>+(1-decay)*X<SUB>t-1</SUB>+(1-decay)<SUP>2</SUP>*X<SUB>t-2</SUB>+ ... +(1-decay)<SUP>t</SUP>*X<SUB>0</SUB>
    Y<SUB>t</SUB> = ------------------------------------------------------
               1+(1-decay)+(1-decay)<SUP>2</SUP>+ ... +(1-decay)<SUP>t</SUP>
		</PRE></I>
        Constructor:<BR>
        <I>
        <PRE>
    ExponentiallyWeightedMeanVisitor(
        exponential_decay_spec eds,  // See exponential_decay_spec type
        double value,                // Value (&alpha;) to be decayed
        bool finite_adjust = false); // Adjust for the fact that this
                                     // is not an infinite data set
        </PRE>
        </I>
      </td>
      <td width="30%">
        <B>T</B>: Column data type<BR>
        <B>I</B>: Index type<BR>
        <B>A</B>: Memory alignment boundary for vectors. Default is system default alignment<BR>
      </td>
    </tr>

    <tr bgcolor="Azure">
      <td>
<pre class="code_syntax" style="color:#000000;background:#ffffff00;"><span class="line_wrapper"><span style="color:#004a43; ">#</span><span style="color:#004a43; ">include </span><span style="color:#800000; ">&lt;</span><span style="color:#40015a; ">DataFrame/DataFrameStatsVisitors.h</span><span style="color:#800000; ">&gt;</span></span>
<span class="line_wrapper"></span>
<span class="line_wrapper"><span style="color:#800000; font-weight:bold; ">template</span><span style="color:#800080; ">&lt;</span><span style="color:#800000; font-weight:bold; ">typename</span> T<span style="color:#808030; ">,</span> <span style="color:#800000; font-weight:bold; ">typename</span> I <span style="color:#808030; ">=</span> <span style="color:#800000; font-weight:bold; ">unsigned</span> <span style="color:#800000; font-weight:bold; ">long</span><span style="color:#808030; ">,</span></span>
<span class="line_wrapper">         <span style="color:#666616; ">std</span><span style="color:#800080; ">::</span><span style="color:#603000; ">size_t</span> A <span style="color:#808030; ">=</span> <span style="color:#008c00; ">0</span><span style="color:#800080; ">&gt;</span></span>
<span class="line_wrapper"><span style="color:#800000; font-weight:bold; ">struct</span> ExponentiallyWeightedVarVisitor<span style="color:#800080; ">;</span></span>
<span class="line_wrapper"></span>
<span class="line_wrapper"><span style="color:#696969; ">// -------------------------------------</span></span>
<span class="line_wrapper"></span>
<span class="line_wrapper"><span style="color:#800000; font-weight:bold; ">template</span><span style="color:#800080; ">&lt;</span><span style="color:#800000; font-weight:bold; ">typename</span> T<span style="color:#808030; ">,</span> <span style="color:#800000; font-weight:bold; ">typename</span> I <span style="color:#808030; ">=</span> <span style="color:#800000; font-weight:bold; ">unsigned</span> <span style="color:#800000; font-weight:bold; ">long</span><span style="color:#808030; ">,</span></span>
<span class="line_wrapper">         <span style="color:#666616; ">std</span><span style="color:#800080; ">::</span><span style="color:#603000; ">size_t</span> A <span style="color:#808030; ">=</span> <span style="color:#008c00; ">0</span><span style="color:#800080; ">&gt;</span></span>
<span class="line_wrapper"><span style="color:#800000; font-weight:bold; ">using</span> ewm_var_v <span style="color:#808030; ">=</span> ExponentiallyWeightedVarVisitor<span style="color:#800080; ">&lt;</span>T<span style="color:#808030; ">,</span> I<span style="color:#808030; ">,</span> A<span style="color:#800080; ">&gt;</span><span style="color:#800080; ">;</span></span>
<span class="line_wrapper"></span></pre>
      </td>
      <td>
        This is a "single action visitor", meaning it is passed the whole data vector in one call and you must use the single_act_visit() interface.<BR><BR>

        This visitor calculates exponentially weighted variance and standard deviation. It gives more weight to recent data by using a decay factor. get_result() returns the vector of EWM variances. There is also a get_std() that returns the vector of EWM standard deviations.<BR><BR>
        Constructor:<BR>
        <I>
        <PRE>
    ExponentiallyWeightedVarVisitor(
        exponential_decay_spec eds, // See exponential_decay_spec type
        double value);              // Value (&alpha;) to be decayed
        </PRE>
        </I>
      </td>
      <td width="30%">
        <B>T</B>: Column data type<BR>
        <B>I</B>: Index type<BR>
        <B>A</B>: Memory alignment boundary for vectors. Default is system default alignment<BR>
      </td>
    </tr>

    <tr bgcolor="Azure">
      <td>
<pre class="code_syntax" style="color:#000000;background:#ffffff00;"><span class="line_wrapper"><span style="color:#004a43; ">#</span><span style="color:#004a43; ">include </span><span style="color:#800000; ">&lt;</span><span style="color:#40015a; ">DataFrame/DataFrameStatsVisitors.h</span><span style="color:#800000; ">&gt;</span></span>
<span class="line_wrapper"></span>
<span class="line_wrapper"><span style="color:#800000; font-weight:bold; ">template</span><span style="color:#800080; ">&lt;</span><span style="color:#800000; font-weight:bold; ">typename</span> T<span style="color:#808030; ">,</span> <span style="color:#800000; font-weight:bold; ">typename</span> I <span style="color:#808030; ">=</span> <span style="color:#800000; font-weight:bold; ">unsigned</span> <span style="color:#800000; font-weight:bold; ">long</span><span style="color:#808030; ">,</span></span>
<span class="line_wrapper">         <span style="color:#666616; ">std</span><span style="color:#800080; ">::</span><span style="color:#603000; ">size_t</span> A <span style="color:#808030; ">=</span> <span style="color:#008c00; ">0</span><span style="color:#800080; ">&gt;</span></span>
<span class="line_wrapper"><span style="color:#800000; font-weight:bold; ">struct</span> ExponentiallyWeightedCovVisitor<span style="color:#800080; ">;</span></span>
<span class="line_wrapper"></span>
<span class="line_wrapper"><span style="color:#696969; ">// -------------------------------------</span></span>
<span class="line_wrapper"></span>
<span class="line_wrapper"><span style="color:#800000; font-weight:bold; ">template</span><span style="color:#800080; ">&lt;</span><span style="color:#800000; font-weight:bold; ">typename</span> T<span style="color:#808030; ">,</span> <span style="color:#800000; font-weight:bold; ">typename</span> I <span style="color:#808030; ">=</span> <span style="color:#800000; font-weight:bold; ">unsigned</span> <span style="color:#800000; font-weight:bold; ">long</span><span style="color:#808030; ">,</span></span>
<span class="line_wrapper">         <span style="color:#666616; ">std</span><span style="color:#800080; ">::</span><span style="color:#603000; ">size_t</span> A <span style="color:#808030; ">=</span> <span style="color:#008c00; ">0</span><span style="color:#800080; ">&gt;</span></span>
<span class="line_wrapper"><span style="color:#800000; font-weight:bold; ">using</span> ewm_cov_v <span style="color:#808030; ">=</span> ExponentiallyWeightedCovVisitor<span style="color:#800080; ">&lt;</span>T<span style="color:#808030; ">,</span> I<span style="color:#808030; ">,</span> A<span style="color:#800080; ">&gt;</span><span style="color:#800080; ">;</span></span>
<span class="line_wrapper"></span></pre>
      </td>
      <td>
        This is a "single action visitor", meaning it is passed the whole data vector in one call and you must use the single_act_visit() interface.<BR><BR>

        This visitor calculates exponentially weighted covariance. It gives more weight to recent data by using a decay factor. get_result() returns the vector of EWM covariances.
        Constructor:<BR>
        <I>
        <PRE>
    ExponentiallyWeightedCovVisitor(
        exponential_decay_spec eds, // See exponential_decay_spec type
        double value);              // Value (&alpha;) to be decayed
        </PRE>
        </I>
      </td width="30%">
      <td>
        <B>T</B>: Column data type<BR>
        <B>I</B>: Index type<BR>
        <B>A</B>: Memory alignment boundary for vectors. Default is system default alignment<BR>
      </td>
    </tr>

    <tr bgcolor="Azure">
      <td>
<pre class="code_syntax" style="color:#000000;background:#ffffff00;"><span class="line_wrapper"><span style="color:#004a43; ">#</span><span style="color:#004a43; ">include </span><span style="color:#800000; ">&lt;</span><span style="color:#40015a; ">DataFrame/DataFrameStatsVisitors.h</span><span style="color:#800000; ">&gt;</span></span>
<span class="line_wrapper"></span>
<span class="line_wrapper"><span style="color:#800000; font-weight:bold; ">template</span><span style="color:#800080; ">&lt;</span><span style="color:#800000; font-weight:bold; ">typename</span> T<span style="color:#808030; ">,</span> <span style="color:#800000; font-weight:bold; ">typename</span> I <span style="color:#808030; ">=</span> <span style="color:#800000; font-weight:bold; ">unsigned</span> <span style="color:#800000; font-weight:bold; ">long</span><span style="color:#808030; ">,</span></span>
<span class="line_wrapper">         <span style="color:#666616; ">std</span><span style="color:#800080; ">::</span><span style="color:#603000; ">size_t</span> A <span style="color:#808030; ">=</span> <span style="color:#008c00; ">0</span><span style="color:#800080; ">&gt;</span></span>
<span class="line_wrapper"><span style="color:#800000; font-weight:bold; ">struct</span> ExponentiallyWeightedCorrVisitor<span style="color:#800080; ">;</span></span>
<span class="line_wrapper"></span>
<span class="line_wrapper"><span style="color:#696969; ">// -------------------------------------</span></span>
<span class="line_wrapper"></span>
<span class="line_wrapper"><span style="color:#800000; font-weight:bold; ">template</span><span style="color:#800080; ">&lt;</span><span style="color:#800000; font-weight:bold; ">typename</span> T<span style="color:#808030; ">,</span> <span style="color:#800000; font-weight:bold; ">typename</span> I <span style="color:#808030; ">=</span> <span style="color:#800000; font-weight:bold; ">unsigned</span> <span style="color:#800000; font-weight:bold; ">long</span><span style="color:#808030; ">,</span></span>
<span class="line_wrapper">         <span style="color:#666616; ">std</span><span style="color:#800080; ">::</span><span style="color:#603000; ">size_t</span> A <span style="color:#808030; ">=</span> <span style="color:#008c00; ">0</span><span style="color:#800080; ">&gt;</span></span>
<span class="line_wrapper"><span style="color:#800000; font-weight:bold; ">using</span> ewm_corr_v <span style="color:#808030; ">=</span> ExponentiallyWeightedCorrVisitor<span style="color:#800080; ">&lt;</span>T<span style="color:#808030; ">,</span> I<span style="color:#808030; ">,</span> A<span style="color:#800080; ">&gt;</span><span style="color:#800080; ">;</span></span>
<span class="line_wrapper"></span></pre>
      </td>
      <td>
        This is a "single action visitor", meaning it is passed the whole data vector in one call and you must use the single_act_visit() interface.<BR><BR>

        This visitor calculates exponentially weighted correlation. It gives more weight to recent data by using a decay factor. get_result() returns the vector of EWM correlations.
        Constructor:<BR>
        <I>
        <PRE>
    ExponentiallyWeightedCorrVisitor(
        exponential_decay_spec eds, // See exponential_decay_spec type
        double value);              // Value (&alpha;) to be decayed
        </PRE>
        </I>
      </td>
      <td width="30%">
        <B>T</B>: Column data type<BR>
        <B>I</B>: Index type<BR>
        <B>A</B>: Memory alignment boundary for vectors. Default is system default alignment<BR>
      </td>
    </tr>

  </table>

  <BR>

<pre style='color:#000000;background:#ffffff00;'><span style='color:#800000; font-weight:bold; '>static</span> <span style='color:#800000; font-weight:bold; '>void</span> test_ExponentiallyWeightedMeanVisitor<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span>  <span style='color:#800080; '>{</span>

    <span style='color:#666616; '>std</span><span style='color:#800080; '>::</span><span style='color:#603000; '>cout</span> <span style='color:#808030; '>&lt;</span><span style='color:#808030; '>&lt;</span> <span style='color:#800000; '>"</span><span style='color:#0f69ff; '>\n</span><span style='color:#0000e6; '>Testing ExponentiallyWeightedMeanVisitor{ } ...</span><span style='color:#800000; '>"</span>
              <span style='color:#808030; '>&lt;</span><span style='color:#808030; '>&lt;</span> <span style='color:#666616; '>std</span><span style='color:#800080; '>::</span><span style='color:#603000; '>endl</span><span style='color:#800080; '>;</span>

    <span style='color:#666616; '>std</span><span style='color:#800080; '>::</span><span style='color:#603000; '>vector</span><span style='color:#800080; '>&lt;</span><span style='color:#800000; font-weight:bold; '>unsigned</span> <span style='color:#800000; font-weight:bold; '>long</span><span style='color:#800080; '>></span>  idx <span style='color:#808030; '>=</span>
        <span style='color:#800080; '>{</span> <span style='color:#008c00; '>123450</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>123451</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>123452</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>123453</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>123454</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>123455</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>123456</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>123457</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>123458</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>123459</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>123460</span> <span style='color:#800080; '>}</span><span style='color:#800080; '>;</span>
    <span style='color:#666616; '>std</span><span style='color:#800080; '>::</span><span style='color:#603000; '>vector</span><span style='color:#800080; '>&lt;</span><span style='color:#800000; font-weight:bold; '>double</span><span style='color:#800080; '>></span> d1 <span style='color:#808030; '>=</span> <span style='color:#800080; '>{</span> <span style='color:#008c00; '>1</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>2</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>3</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>4</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>5</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>6</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>7</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>8</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>9</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>10</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>11</span> <span style='color:#800080; '>}</span><span style='color:#800080; '>;</span>
    <span style='color:#666616; '>std</span><span style='color:#800080; '>::</span><span style='color:#603000; '>vector</span><span style='color:#800080; '>&lt;</span><span style='color:#800000; font-weight:bold; '>double</span><span style='color:#800080; '>></span> d2 <span style='color:#808030; '>=</span> <span style='color:#800080; '>{</span> <span style='color:#008c00; '>8</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>9</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>10</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>11</span><span style='color:#808030; '>,</span>
                               <span style='color:#666616; '>std</span><span style='color:#800080; '>::</span>numeric_limits<span style='color:#800080; '>&lt;</span><span style='color:#800000; font-weight:bold; '>double</span><span style='color:#800080; '>></span><span style='color:#800080; '>::</span>quiet_NaN<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#808030; '>,</span>
                               <span style='color:#008c00; '>13</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>14</span><span style='color:#808030; '>,</span>
                               <span style='color:#666616; '>std</span><span style='color:#800080; '>::</span>numeric_limits<span style='color:#800080; '>&lt;</span><span style='color:#800000; font-weight:bold; '>double</span><span style='color:#800080; '>></span><span style='color:#800080; '>::</span>quiet_NaN<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#808030; '>,</span>
                               <span style='color:#008c00; '>16</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>17</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>18</span> <span style='color:#800080; '>}</span><span style='color:#800080; '>;</span>
    <span style='color:#666616; '>std</span><span style='color:#800080; '>::</span><span style='color:#603000; '>vector</span><span style='color:#800080; '>&lt;</span><span style='color:#800000; font-weight:bold; '>double</span><span style='color:#800080; '>></span> d3 <span style='color:#808030; '>=</span> <span style='color:#800080; '>{</span> <span style='color:#008c00; '>15</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>16</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>17</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>18</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>19</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>20</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>21</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>22</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>23</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>24</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>25</span> <span style='color:#800080; '>}</span><span style='color:#800080; '>;</span>
    <span style='color:#666616; '>std</span><span style='color:#800080; '>::</span><span style='color:#603000; '>vector</span><span style='color:#800080; '>&lt;</span><span style='color:#800000; font-weight:bold; '>double</span><span style='color:#800080; '>></span> d4 <span style='color:#808030; '>=</span> <span style='color:#800080; '>{</span> <span style='color:#008c00; '>22</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>23</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>24</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>25</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>26</span><span style='color:#808030; '>,</span> <span style='color:#008c00; '>27</span> <span style='color:#800080; '>}</span><span style='color:#800080; '>;</span>
    <span style='color:#666616; '>std</span><span style='color:#800080; '>::</span><span style='color:#603000; '>vector</span><span style='color:#800080; '>&lt;</span><span style='color:#666616; '>std</span><span style='color:#800080; '>::</span><span style='color:#603000; '>string</span><span style='color:#800080; '>></span> s1 <span style='color:#808030; '>=</span> <span style='color:#800080; '>{</span> <span style='color:#800000; '>"</span><span style='color:#0000e6; '>11</span><span style='color:#800000; '>"</span><span style='color:#808030; '>,</span> <span style='color:#800000; '>"</span><span style='color:#0000e6; '>22</span><span style='color:#800000; '>"</span><span style='color:#808030; '>,</span> <span style='color:#800000; '>"</span><span style='color:#0000e6; '>33</span><span style='color:#800000; '>"</span><span style='color:#808030; '>,</span> <span style='color:#800000; '>"</span><span style='color:#0000e6; '>aa</span><span style='color:#800000; '>"</span><span style='color:#808030; '>,</span> <span style='color:#800000; '>"</span><span style='color:#0000e6; '>bb</span><span style='color:#800000; '>"</span><span style='color:#808030; '>,</span> <span style='color:#800000; '>"</span><span style='color:#0000e6; '>cc</span><span style='color:#800000; '>"</span><span style='color:#808030; '>,</span> <span style='color:#800000; '>"</span><span style='color:#0000e6; '>dd</span><span style='color:#800000; '>"</span> <span style='color:#800000; '>"</span><span style='color:#0000e6; '>tt</span><span style='color:#800000; '>"</span><span style='color:#808030; '>,</span> <span style='color:#800000; '>"</span><span style='color:#0000e6; '>uu</span><span style='color:#800000; '>"</span><span style='color:#808030; '>,</span> <span style='color:#800000; '>"</span><span style='color:#0000e6; '>ii</span><span style='color:#800000; '>"</span><span style='color:#808030; '>,</span> <span style='color:#800000; '>"</span><span style='color:#0000e6; '>88</span><span style='color:#800000; '>"</span> <span style='color:#800080; '>}</span><span style='color:#800080; '>;</span>
    MyDataFrame         df<span style='color:#800080; '>;</span>

    df<span style='color:#808030; '>.</span>load_data<span style='color:#808030; '>(</span><span style='color:#666616; '>std</span><span style='color:#800080; '>::</span><span style='color:#603000; '>move</span><span style='color:#808030; '>(</span>idx<span style='color:#808030; '>)</span><span style='color:#808030; '>,</span>
                 <span style='color:#666616; '>std</span><span style='color:#800080; '>::</span>make_pair<span style='color:#808030; '>(</span><span style='color:#800000; '>"</span><span style='color:#0000e6; '>col_1</span><span style='color:#800000; '>"</span><span style='color:#808030; '>,</span> d1<span style='color:#808030; '>)</span><span style='color:#808030; '>,</span>
                 <span style='color:#666616; '>std</span><span style='color:#800080; '>::</span>make_pair<span style='color:#808030; '>(</span><span style='color:#800000; '>"</span><span style='color:#0000e6; '>col_2</span><span style='color:#800000; '>"</span><span style='color:#808030; '>,</span> d2<span style='color:#808030; '>)</span><span style='color:#808030; '>,</span>
                 <span style='color:#666616; '>std</span><span style='color:#800080; '>::</span>make_pair<span style='color:#808030; '>(</span><span style='color:#800000; '>"</span><span style='color:#0000e6; '>col_3</span><span style='color:#800000; '>"</span><span style='color:#808030; '>,</span> d3<span style='color:#808030; '>)</span><span style='color:#808030; '>,</span>
                 <span style='color:#666616; '>std</span><span style='color:#800080; '>::</span>make_pair<span style='color:#808030; '>(</span><span style='color:#800000; '>"</span><span style='color:#0000e6; '>col_str</span><span style='color:#800000; '>"</span><span style='color:#808030; '>,</span> s1<span style='color:#808030; '>)</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
    df<span style='color:#808030; '>.</span>load_column<span style='color:#808030; '>(</span><span style='color:#800000; '>"</span><span style='color:#0000e6; '>col_4</span><span style='color:#800000; '>"</span><span style='color:#808030; '>,</span> <span style='color:#666616; '>std</span><span style='color:#800080; '>::</span><span style='color:#603000; '>move</span><span style='color:#808030; '>(</span>d4<span style='color:#808030; '>)</span><span style='color:#808030; '>,</span> nan_policy<span style='color:#800080; '>::</span>dont_pad_with_nans<span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>

    ewm_v<span style='color:#800080; '>&lt;</span><span style='color:#800000; font-weight:bold; '>double</span><span style='color:#800080; '>></span>   hl_expo_mean_roller<span style='color:#808030; '>(</span>exponential_decay_spec<span style='color:#800080; '>::</span>halflife<span style='color:#808030; '>,</span> <span style='color:#008000; '>0.5</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
    <span style='color:#800000; font-weight:bold; '>const</span> <span style='color:#800000; font-weight:bold; '>auto</span>      <span style='color:#808030; '>&amp;</span>hl_expo_result <span style='color:#808030; '>=</span> df<span style='color:#808030; '>.</span>single_act_visit<span style='color:#800080; '>&lt;</span><span style='color:#800000; font-weight:bold; '>double</span><span style='color:#800080; '>></span><span style='color:#808030; '>(</span><span style='color:#800000; '>"</span><span style='color:#0000e6; '>col_3</span><span style='color:#800000; '>"</span><span style='color:#808030; '>,</span> hl_expo_mean_roller<span style='color:#808030; '>)</span><span style='color:#808030; '>.</span>get_result<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>

    assert<span style='color:#808030; '>(</span>hl_expo_result<span style='color:#808030; '>.</span>size<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span> <span style='color:#808030; '>=</span><span style='color:#808030; '>=</span> <span style='color:#008c00; '>11</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
    assert<span style='color:#808030; '>(</span>hl_expo_result<span style='color:#808030; '>[</span><span style='color:#008c00; '>0</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>=</span><span style='color:#808030; '>=</span> <span style='color:#008000; '>15.0</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
    assert<span style='color:#808030; '>(</span><span style='color:#603000; '>fabs</span><span style='color:#808030; '>(</span>hl_expo_result<span style='color:#808030; '>[</span><span style='color:#008c00; '>1</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>-</span> <span style='color:#008000; '>15.75</span><span style='color:#808030; '>)</span> <span style='color:#808030; '>&lt;</span> <span style='color:#008000; '>0.01</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
    assert<span style='color:#808030; '>(</span><span style='color:#603000; '>fabs</span><span style='color:#808030; '>(</span>hl_expo_result<span style='color:#808030; '>[</span><span style='color:#008c00; '>2</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>-</span> <span style='color:#008000; '>16.6875</span><span style='color:#808030; '>)</span> <span style='color:#808030; '>&lt;</span> <span style='color:#008000; '>0.0001</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
    assert<span style='color:#808030; '>(</span><span style='color:#603000; '>fabs</span><span style='color:#808030; '>(</span>hl_expo_result<span style='color:#808030; '>[</span><span style='color:#008c00; '>5</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>-</span> <span style='color:#008000; '>19.667</span><span style='color:#808030; '>)</span> <span style='color:#808030; '>&lt;</span> <span style='color:#008000; '>0.001</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
    assert<span style='color:#808030; '>(</span><span style='color:#603000; '>fabs</span><span style='color:#808030; '>(</span>hl_expo_result<span style='color:#808030; '>[</span><span style='color:#008c00; '>8</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>-</span> <span style='color:#008000; '>22.6667</span><span style='color:#808030; '>)</span> <span style='color:#808030; '>&lt;</span> <span style='color:#008000; '>0.0001</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>

    ewm_v<span style='color:#800080; '>&lt;</span><span style='color:#800000; font-weight:bold; '>double</span><span style='color:#800080; '>></span>   cg_expo_mean_roller<span style='color:#808030; '>(</span>exponential_decay_spec<span style='color:#800080; '>::</span>center_of_gravity<span style='color:#808030; '>,</span> <span style='color:#008000; '>0.5</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
    <span style='color:#800000; font-weight:bold; '>const</span> <span style='color:#800000; font-weight:bold; '>auto</span>      <span style='color:#808030; '>&amp;</span>cg_expo_result <span style='color:#808030; '>=</span> df<span style='color:#808030; '>.</span>single_act_visit<span style='color:#800080; '>&lt;</span><span style='color:#800000; font-weight:bold; '>double</span><span style='color:#800080; '>></span><span style='color:#808030; '>(</span><span style='color:#800000; '>"</span><span style='color:#0000e6; '>col_3</span><span style='color:#800000; '>"</span><span style='color:#808030; '>,</span> cg_expo_mean_roller<span style='color:#808030; '>)</span><span style='color:#808030; '>.</span>get_result<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>

    assert<span style='color:#808030; '>(</span>cg_expo_result<span style='color:#808030; '>.</span>size<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span> <span style='color:#808030; '>=</span><span style='color:#808030; '>=</span> <span style='color:#008c00; '>11</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
    assert<span style='color:#808030; '>(</span>cg_expo_result<span style='color:#808030; '>[</span><span style='color:#008c00; '>0</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>=</span><span style='color:#808030; '>=</span> <span style='color:#008000; '>15.0</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
    assert<span style='color:#808030; '>(</span><span style='color:#603000; '>fabs</span><span style='color:#808030; '>(</span>cg_expo_result<span style='color:#808030; '>[</span><span style='color:#008c00; '>1</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>-</span> <span style='color:#008000; '>15.6667</span><span style='color:#808030; '>)</span> <span style='color:#808030; '>&lt;</span> <span style='color:#008000; '>0.0001</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
    assert<span style='color:#808030; '>(</span><span style='color:#603000; '>fabs</span><span style='color:#808030; '>(</span>cg_expo_result<span style='color:#808030; '>[</span><span style='color:#008c00; '>2</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>-</span> <span style='color:#008000; '>16.5556</span><span style='color:#808030; '>)</span> <span style='color:#808030; '>&lt;</span> <span style='color:#008000; '>0.0001</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
    assert<span style='color:#808030; '>(</span><span style='color:#603000; '>fabs</span><span style='color:#808030; '>(</span>cg_expo_result<span style='color:#808030; '>[</span><span style='color:#008c00; '>5</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>-</span> <span style='color:#008000; '>19.5021</span><span style='color:#808030; '>)</span> <span style='color:#808030; '>&lt;</span> <span style='color:#008000; '>0.0001</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
    assert<span style='color:#808030; '>(</span><span style='color:#603000; '>fabs</span><span style='color:#808030; '>(</span>cg_expo_result<span style='color:#808030; '>[</span><span style='color:#008c00; '>8</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>-</span> <span style='color:#008000; '>22.5001</span><span style='color:#808030; '>)</span> <span style='color:#808030; '>&lt;</span> <span style='color:#008000; '>0.0001</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>

    ewm_v<span style='color:#800080; '>&lt;</span><span style='color:#800000; font-weight:bold; '>double</span><span style='color:#800080; '>></span>   s_expo_mean_roller<span style='color:#808030; '>(</span>exponential_decay_spec<span style='color:#800080; '>::</span>span<span style='color:#808030; '>,</span> <span style='color:#008000; '>1.5</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
    <span style='color:#800000; font-weight:bold; '>const</span> <span style='color:#800000; font-weight:bold; '>auto</span>      <span style='color:#808030; '>&amp;</span>s_expo_result <span style='color:#808030; '>=</span> df<span style='color:#808030; '>.</span>single_act_visit<span style='color:#800080; '>&lt;</span><span style='color:#800000; font-weight:bold; '>double</span><span style='color:#800080; '>></span><span style='color:#808030; '>(</span><span style='color:#800000; '>"</span><span style='color:#0000e6; '>col_3</span><span style='color:#800000; '>"</span><span style='color:#808030; '>,</span> s_expo_mean_roller<span style='color:#808030; '>)</span><span style='color:#808030; '>.</span>get_result<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>

    assert<span style='color:#808030; '>(</span>s_expo_result<span style='color:#808030; '>.</span>size<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span> <span style='color:#808030; '>=</span><span style='color:#808030; '>=</span> <span style='color:#008c00; '>11</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
    assert<span style='color:#808030; '>(</span>s_expo_result<span style='color:#808030; '>[</span><span style='color:#008c00; '>0</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>=</span><span style='color:#808030; '>=</span> <span style='color:#008000; '>15.0</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
    assert<span style='color:#808030; '>(</span><span style='color:#603000; '>fabs</span><span style='color:#808030; '>(</span>s_expo_result<span style='color:#808030; '>[</span><span style='color:#008c00; '>1</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>-</span> <span style='color:#008000; '>15.8</span><span style='color:#808030; '>)</span> <span style='color:#808030; '>&lt;</span> <span style='color:#008000; '>0.01</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
    assert<span style='color:#808030; '>(</span><span style='color:#603000; '>fabs</span><span style='color:#808030; '>(</span>s_expo_result<span style='color:#808030; '>[</span><span style='color:#008c00; '>2</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>-</span> <span style='color:#008000; '>16.76</span><span style='color:#808030; '>)</span> <span style='color:#808030; '>&lt;</span> <span style='color:#008000; '>0.001</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
    assert<span style='color:#808030; '>(</span><span style='color:#603000; '>fabs</span><span style='color:#808030; '>(</span>s_expo_result<span style='color:#808030; '>[</span><span style='color:#008c00; '>5</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>-</span> <span style='color:#008000; '>19.7501</span><span style='color:#808030; '>)</span> <span style='color:#808030; '>&lt;</span> <span style='color:#008000; '>0.0001</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
    assert<span style='color:#808030; '>(</span><span style='color:#603000; '>fabs</span><span style='color:#808030; '>(</span>s_expo_result<span style='color:#808030; '>[</span><span style='color:#008c00; '>8</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>-</span> <span style='color:#008000; '>22.75</span><span style='color:#808030; '>)</span> <span style='color:#808030; '>&lt;</span> <span style='color:#008000; '>0.001</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>

    ewm_v<span style='color:#800080; '>&lt;</span><span style='color:#800000; font-weight:bold; '>double</span><span style='color:#800080; '>></span>   f_expo_mean_roller<span style='color:#808030; '>(</span>exponential_decay_spec<span style='color:#800080; '>::</span>fixed<span style='color:#808030; '>,</span> <span style='color:#008000; '>0.5</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
    <span style='color:#800000; font-weight:bold; '>const</span> <span style='color:#800000; font-weight:bold; '>auto</span>      <span style='color:#808030; '>&amp;</span>f_expo_result <span style='color:#808030; '>=</span> df<span style='color:#808030; '>.</span>single_act_visit<span style='color:#800080; '>&lt;</span><span style='color:#800000; font-weight:bold; '>double</span><span style='color:#800080; '>></span><span style='color:#808030; '>(</span><span style='color:#800000; '>"</span><span style='color:#0000e6; '>col_3</span><span style='color:#800000; '>"</span><span style='color:#808030; '>,</span> f_expo_mean_roller<span style='color:#808030; '>)</span><span style='color:#808030; '>.</span>get_result<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>

    assert<span style='color:#808030; '>(</span>f_expo_result<span style='color:#808030; '>.</span>size<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span> <span style='color:#808030; '>=</span><span style='color:#808030; '>=</span> <span style='color:#008c00; '>11</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
    assert<span style='color:#808030; '>(</span>f_expo_result<span style='color:#808030; '>[</span><span style='color:#008c00; '>0</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>=</span><span style='color:#808030; '>=</span> <span style='color:#008000; '>15.0</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
    assert<span style='color:#808030; '>(</span><span style='color:#603000; '>fabs</span><span style='color:#808030; '>(</span>f_expo_result<span style='color:#808030; '>[</span><span style='color:#008c00; '>1</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>-</span> <span style='color:#008000; '>15.5</span><span style='color:#808030; '>)</span> <span style='color:#808030; '>&lt;</span> <span style='color:#008000; '>0.01</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
    assert<span style='color:#808030; '>(</span><span style='color:#603000; '>fabs</span><span style='color:#808030; '>(</span>f_expo_result<span style='color:#808030; '>[</span><span style='color:#008c00; '>2</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>-</span> <span style='color:#008000; '>16.25</span><span style='color:#808030; '>)</span> <span style='color:#808030; '>&lt;</span> <span style='color:#008000; '>0.001</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
    assert<span style='color:#808030; '>(</span><span style='color:#603000; '>fabs</span><span style='color:#808030; '>(</span>f_expo_result<span style='color:#808030; '>[</span><span style='color:#008c00; '>5</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>-</span> <span style='color:#008000; '>19.0312</span><span style='color:#808030; '>)</span> <span style='color:#808030; '>&lt;</span> <span style='color:#008000; '>0.0001</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
    assert<span style='color:#808030; '>(</span><span style='color:#603000; '>fabs</span><span style='color:#808030; '>(</span>f_expo_result<span style='color:#808030; '>[</span><span style='color:#008c00; '>8</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>-</span> <span style='color:#008000; '>22.0039</span><span style='color:#808030; '>)</span> <span style='color:#808030; '>&lt;</span> <span style='color:#008000; '>0.0001</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>

    ewm_v<span style='color:#800080; '>&lt;</span><span style='color:#800000; font-weight:bold; '>double</span><span style='color:#800080; '>></span>   expo_mean_roller_3<span style='color:#808030; '>(</span>exponential_decay_spec<span style='color:#800080; '>::</span>span<span style='color:#808030; '>,</span> <span style='color:#008c00; '>3</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
    <span style='color:#800000; font-weight:bold; '>const</span> <span style='color:#800000; font-weight:bold; '>auto</span>      <span style='color:#808030; '>&amp;</span>expo_result_3 <span style='color:#808030; '>=</span> df<span style='color:#808030; '>.</span>single_act_visit<span style='color:#800080; '>&lt;</span><span style='color:#800000; font-weight:bold; '>double</span><span style='color:#800080; '>></span><span style='color:#808030; '>(</span><span style='color:#800000; '>"</span><span style='color:#0000e6; '>col_3</span><span style='color:#800000; '>"</span><span style='color:#808030; '>,</span> expo_mean_roller_3<span style='color:#808030; '>)</span><span style='color:#808030; '>.</span>get_result<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>

    assert<span style='color:#808030; '>(</span>expo_result_3<span style='color:#808030; '>.</span>size<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span> <span style='color:#808030; '>=</span><span style='color:#808030; '>=</span> <span style='color:#008c00; '>11</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
    assert<span style='color:#808030; '>(</span>expo_result_3<span style='color:#808030; '>[</span><span style='color:#008c00; '>0</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>=</span><span style='color:#808030; '>=</span> <span style='color:#008000; '>15.0</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
    assert<span style='color:#808030; '>(</span><span style='color:#666616; '>std</span><span style='color:#800080; '>::</span><span style='color:#603000; '>fabs</span><span style='color:#808030; '>(</span>expo_result_3<span style='color:#808030; '>[</span><span style='color:#008c00; '>1</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>-</span> <span style='color:#008000; '>15.5</span><span style='color:#808030; '>)</span> <span style='color:#808030; '>&lt;</span> <span style='color:#008000; '>0.01</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
    assert<span style='color:#808030; '>(</span><span style='color:#666616; '>std</span><span style='color:#800080; '>::</span><span style='color:#603000; '>fabs</span><span style='color:#808030; '>(</span>expo_result_3<span style='color:#808030; '>[</span><span style='color:#008c00; '>2</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>-</span> <span style='color:#008000; '>16.25</span><span style='color:#808030; '>)</span> <span style='color:#808030; '>&lt;</span> <span style='color:#008000; '>0.001</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
    assert<span style='color:#808030; '>(</span><span style='color:#666616; '>std</span><span style='color:#800080; '>::</span><span style='color:#603000; '>fabs</span><span style='color:#808030; '>(</span>expo_result_3<span style='color:#808030; '>[</span><span style='color:#008c00; '>5</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>-</span> <span style='color:#008000; '>19.0312</span><span style='color:#808030; '>)</span> <span style='color:#808030; '>&lt;</span> <span style='color:#008000; '>0.0001</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
    assert<span style='color:#808030; '>(</span><span style='color:#666616; '>std</span><span style='color:#800080; '>::</span><span style='color:#603000; '>fabs</span><span style='color:#808030; '>(</span>expo_result_3<span style='color:#808030; '>[</span><span style='color:#008c00; '>8</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>-</span> <span style='color:#008000; '>22.0039</span><span style='color:#808030; '>)</span> <span style='color:#808030; '>&lt;</span> <span style='color:#008000; '>0.0001</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>

    ewm_v<span style='color:#800080; '>&lt;</span><span style='color:#800000; font-weight:bold; '>double</span><span style='color:#800080; '>></span>   expo_mean_roller_3_t<span style='color:#808030; '>(</span>exponential_decay_spec<span style='color:#800080; '>::</span>span<span style='color:#808030; '>,</span> <span style='color:#008c00; '>3</span><span style='color:#808030; '>,</span> <span style='color:#800000; font-weight:bold; '>true</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
    <span style='color:#800000; font-weight:bold; '>const</span> <span style='color:#800000; font-weight:bold; '>auto</span>      <span style='color:#808030; '>&amp;</span>expo_result_3_t <span style='color:#808030; '>=</span> df<span style='color:#808030; '>.</span>single_act_visit<span style='color:#800080; '>&lt;</span><span style='color:#800000; font-weight:bold; '>double</span><span style='color:#800080; '>></span><span style='color:#808030; '>(</span><span style='color:#800000; '>"</span><span style='color:#0000e6; '>col_3</span><span style='color:#800000; '>"</span><span style='color:#808030; '>,</span> expo_mean_roller_3_t<span style='color:#808030; '>)</span><span style='color:#808030; '>.</span>get_result<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>

    assert<span style='color:#808030; '>(</span>expo_result_3_t<span style='color:#808030; '>.</span>size<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span> <span style='color:#808030; '>=</span><span style='color:#808030; '>=</span> <span style='color:#008c00; '>11</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
    assert<span style='color:#808030; '>(</span>expo_result_3_t<span style='color:#808030; '>[</span><span style='color:#008c00; '>0</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>=</span><span style='color:#808030; '>=</span> <span style='color:#008000; '>15.0</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
    assert<span style='color:#808030; '>(</span><span style='color:#666616; '>std</span><span style='color:#800080; '>::</span><span style='color:#603000; '>fabs</span><span style='color:#808030; '>(</span>expo_result_3_t<span style='color:#808030; '>[</span><span style='color:#008c00; '>1</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>-</span> <span style='color:#008000; '>15.6667</span><span style='color:#808030; '>)</span> <span style='color:#808030; '>&lt;</span> <span style='color:#008000; '>0.0001</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
    assert<span style='color:#808030; '>(</span><span style='color:#666616; '>std</span><span style='color:#800080; '>::</span><span style='color:#603000; '>fabs</span><span style='color:#808030; '>(</span>expo_result_3_t<span style='color:#808030; '>[</span><span style='color:#008c00; '>2</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>-</span> <span style='color:#008000; '>16.4286</span><span style='color:#808030; '>)</span> <span style='color:#808030; '>&lt;</span> <span style='color:#008000; '>0.0001</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
    assert<span style='color:#808030; '>(</span><span style='color:#666616; '>std</span><span style='color:#800080; '>::</span><span style='color:#603000; '>fabs</span><span style='color:#808030; '>(</span>expo_result_3_t<span style='color:#808030; '>[</span><span style='color:#008c00; '>5</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>-</span> <span style='color:#008000; '>19.0952</span><span style='color:#808030; '>)</span> <span style='color:#808030; '>&lt;</span> <span style='color:#008000; '>0.0001</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
    assert<span style='color:#808030; '>(</span><span style='color:#666616; '>std</span><span style='color:#800080; '>::</span><span style='color:#603000; '>fabs</span><span style='color:#808030; '>(</span>expo_result_3_t<span style='color:#808030; '>[</span><span style='color:#008c00; '>8</span><span style='color:#808030; '>]</span> <span style='color:#808030; '>-</span> <span style='color:#008000; '>22.0176</span><span style='color:#808030; '>)</span> <span style='color:#808030; '>&lt;</span> <span style='color:#008000; '>0.0001</span><span style='color:#808030; '>)</span><span style='color:#800080; '>;</span>
<span style='color:#800080; '>}</span>
</pre>

<pre class="code_syntax" style="color:#000000;background:#ffffff00;"><span class="line_wrapper"><span style="color:#696969; ">// -----------------------------------------------------------------------------</span></span>
<span class="line_wrapper"></span>
<span class="line_wrapper"><span style="color:#800000; font-weight:bold; ">static</span> <span style="color:#800000; font-weight:bold; ">void</span> test_ExponentiallyWeightedVarVisitor<span style="color:#808030; ">(</span><span style="color:#808030; ">)</span>  <span style="color:#800080; ">{</span></span>
<span class="line_wrapper"></span>
<span class="line_wrapper">    <span style="color:#666616; ">std</span><span style="color:#800080; ">::</span><span style="color:#603000; ">cout</span> <span style="color:#808030; ">&lt;</span><span style="color:#808030; ">&lt;</span> <span style="color:#800000; ">"</span><span style="color:#0f69ff; ">\n</span><span style="color:#0000e6; ">Testing ExponentiallyWeightedVarVisitor{  } ...</span><span style="color:#800000; ">"</span></span>
<span class="line_wrapper">              <span style="color:#808030; ">&lt;</span><span style="color:#808030; ">&lt;</span> <span style="color:#666616; ">std</span><span style="color:#800080; ">::</span><span style="color:#603000; ">endl</span><span style="color:#800080; ">;</span></span>
<span class="line_wrapper"></span>
<span class="line_wrapper">    StlVecType<span style="color:#800080; ">&lt;</span><span style="color:#800000; font-weight:bold; ">unsigned</span> <span style="color:#800000; font-weight:bold; ">long</span><span style="color:#800080; ">&gt;</span>  idx <span style="color:#808030; ">=</span></span>
<span class="line_wrapper">        <span style="color:#800080; ">{</span> <span style="color:#008c00; ">123450</span><span style="color:#808030; ">,</span> <span style="color:#008c00; ">123451</span><span style="color:#808030; ">,</span> <span style="color:#008c00; ">123452</span><span style="color:#808030; ">,</span> <span style="color:#008c00; ">123453</span><span style="color:#808030; ">,</span> <span style="color:#008c00; ">123454</span><span style="color:#808030; ">,</span> <span style="color:#008c00; ">123455</span><span style="color:#808030; ">,</span> <span style="color:#008c00; ">123456</span><span style="color:#808030; ">,</span></span>
<span class="line_wrapper">          <span style="color:#008c00; ">123457</span><span style="color:#808030; ">,</span> <span style="color:#008c00; ">123458</span><span style="color:#808030; ">,</span> <span style="color:#008c00; ">123459</span><span style="color:#808030; ">,</span> <span style="color:#008c00; ">123460</span><span style="color:#808030; ">,</span> <span style="color:#008c00; ">123461</span><span style="color:#808030; ">,</span> <span style="color:#008c00; ">123462</span><span style="color:#808030; ">,</span> <span style="color:#008c00; ">123466</span><span style="color:#808030; ">,</span> <span style="color:#008c00; ">123467</span><span style="color:#808030; ">,</span> <span style="color:#008c00; ">123468</span> <span style="color:#800080; ">}</span><span style="color:#800080; ">;</span></span>
<span class="line_wrapper">    StlVecType<span style="color:#800080; ">&lt;</span><span style="color:#800000; font-weight:bold; ">double</span><span style="color:#800080; ">&gt;</span>         d1 <span style="color:#808030; ">=</span></span>
<span class="line_wrapper">        <span style="color:#800080; ">{</span> <span style="color:#008000; ">1.0</span><span style="color:#808030; ">,</span> <span style="color:#008000; ">1.5</span><span style="color:#808030; ">,</span> <span style="color:#008000; ">1.0</span><span style="color:#808030; ">,</span> <span style="color:#008000; ">1.2</span><span style="color:#808030; ">,</span> <span style="color:#008000; ">1.7</span><span style="color:#808030; ">,</span> <span style="color:#008000; ">1.5</span><span style="color:#808030; ">,</span> <span style="color:#008000; ">1.2</span><span style="color:#808030; ">,</span> <span style="color:#008000; ">1.7</span><span style="color:#808030; ">,</span> <span style="color:#008000; ">1.7</span><span style="color:#808030; ">,</span> <span style="color:#008000; ">1.3</span><span style="color:#808030; ">,</span> <span style="color:#008000; ">1.4</span><span style="color:#808030; ">,</span> <span style="color:#008000; ">1.5</span><span style="color:#808030; ">,</span> <span style="color:#008000; ">1.2</span><span style="color:#808030; ">,</span> <span style="color:#008000; ">1.1</span><span style="color:#808030; ">,</span> <span style="color:#008000; ">1.15</span><span style="color:#808030; ">,</span> <span style="color:#008000; ">1.0</span> <span style="color:#800080; ">}</span><span style="color:#800080; ">;</span></span>
<span class="line_wrapper">    StlVecType<span style="color:#800080; ">&lt;</span><span style="color:#800000; font-weight:bold; ">double</span><span style="color:#800080; ">&gt;</span>         d2 <span style="color:#808030; ">=</span></span>
<span class="line_wrapper">        <span style="color:#800080; ">{</span> <span style="color:#008000; ">0.2</span><span style="color:#808030; ">,</span> <span style="color:#008000; ">0.58</span><span style="color:#808030; ">,</span> <span style="color:#808030; ">-</span><span style="color:#008000; ">0.60</span><span style="color:#808030; ">,</span> <span style="color:#808030; ">-</span><span style="color:#008000; ">0.08</span><span style="color:#808030; ">,</span> <span style="color:#008000; ">0.05</span><span style="color:#808030; ">,</span> <span style="color:#008000; ">0.87</span><span style="color:#808030; ">,</span> <span style="color:#008000; ">0.2</span><span style="color:#808030; ">,</span> <span style="color:#008000; ">0.4</span><span style="color:#808030; ">,</span> <span style="color:#008000; ">0.5</span><span style="color:#808030; ">,</span> <span style="color:#008000; ">0.06</span><span style="color:#808030; ">,</span> <span style="color:#008000; ">0.3</span><span style="color:#808030; ">,</span> <span style="color:#808030; ">-</span><span style="color:#008000; ">0.34</span><span style="color:#808030; ">,</span></span>
<span class="line_wrapper">          <span style="color:#808030; ">-</span><span style="color:#008000; ">0.9</span><span style="color:#808030; ">,</span> <span style="color:#008000; ">0.8</span><span style="color:#808030; ">,</span> <span style="color:#808030; ">-</span><span style="color:#008000; ">0.4</span><span style="color:#808030; ">,</span> <span style="color:#008000; ">0.86</span> <span style="color:#800080; ">}</span><span style="color:#800080; ">;</span></span>
<span class="line_wrapper">    StlVecType<span style="color:#800080; ">&lt;</span><span style="color:#800000; font-weight:bold; ">int</span><span style="color:#800080; ">&gt;</span>            i1 <span style="color:#808030; ">=</span> <span style="color:#800080; ">{</span> <span style="color:#008c00; ">22</span><span style="color:#808030; ">,</span> <span style="color:#008c00; ">23</span><span style="color:#808030; ">,</span> <span style="color:#008c00; ">24</span><span style="color:#808030; ">,</span> <span style="color:#008c00; ">25</span><span style="color:#808030; ">,</span> <span style="color:#008c00; ">99</span> <span style="color:#800080; ">}</span><span style="color:#800080; ">;</span></span>
<span class="line_wrapper">    MyDataFrame                df<span style="color:#800080; ">;</span></span>
<span class="line_wrapper"></span>
<span class="line_wrapper">    df<span style="color:#808030; ">.</span>load_data<span style="color:#808030; ">(</span><span style="color:#666616; ">std</span><span style="color:#800080; ">::</span><span style="color:#603000; ">move</span><span style="color:#808030; ">(</span>idx<span style="color:#808030; ">)</span><span style="color:#808030; ">,</span></span>
<span class="line_wrapper">                 <span style="color:#666616; ">std</span><span style="color:#800080; ">::</span>make_pair<span style="color:#808030; ">(</span><span style="color:#800000; ">"</span><span style="color:#0000e6; ">values</span><span style="color:#800000; ">"</span><span style="color:#808030; ">,</span> d1<span style="color:#808030; ">)</span><span style="color:#808030; ">,</span></span>
<span class="line_wrapper">                 <span style="color:#666616; ">std</span><span style="color:#800080; ">::</span>make_pair<span style="color:#808030; ">(</span><span style="color:#800000; ">"</span><span style="color:#0000e6; ">benchmark</span><span style="color:#800000; ">"</span><span style="color:#808030; ">,</span> d2<span style="color:#808030; ">)</span><span style="color:#808030; ">,</span></span>
<span class="line_wrapper">                 <span style="color:#666616; ">std</span><span style="color:#800080; ">::</span>make_pair<span style="color:#808030; ">(</span><span style="color:#800000; ">"</span><span style="color:#0000e6; ">col_3</span><span style="color:#800000; ">"</span><span style="color:#808030; ">,</span> i1<span style="color:#808030; ">)</span><span style="color:#808030; ">)</span><span style="color:#800080; ">;</span></span>
<span class="line_wrapper"></span>
<span class="line_wrapper">    ewm_var_v<span style="color:#800080; ">&lt;</span><span style="color:#800000; font-weight:bold; ">double</span><span style="color:#800080; ">&gt;</span>   ewmvar<span style="color:#808030; ">(</span>exponential_decay_spec<span style="color:#800080; ">::</span>span<span style="color:#808030; ">,</span> <span style="color:#008c00; ">3</span><span style="color:#808030; ">)</span><span style="color:#800080; ">;</span></span>
<span class="line_wrapper">    <span style="color:#800000; font-weight:bold; ">const</span> <span style="color:#800000; font-weight:bold; ">auto</span>          result <span style="color:#808030; ">=</span> df<span style="color:#808030; ">.</span>single_act_visit<span style="color:#800080; ">&lt;</span><span style="color:#800000; font-weight:bold; ">double</span><span style="color:#800080; ">&gt;</span><span style="color:#808030; ">(</span><span style="color:#800000; ">"</span><span style="color:#0000e6; ">values</span><span style="color:#800000; ">"</span><span style="color:#808030; ">,</span> ewmvar<span style="color:#808030; ">)</span><span style="color:#808030; ">.</span>get_result<span style="color:#808030; ">(</span><span style="color:#808030; ">)</span><span style="color:#800080; ">;</span></span>
<span class="line_wrapper"></span>
<span class="line_wrapper">    assert<span style="color:#808030; ">(</span>result<span style="color:#808030; ">.</span>size<span style="color:#808030; ">(</span><span style="color:#808030; ">)</span> <span style="color:#808030; ">=</span><span style="color:#808030; ">=</span> <span style="color:#008c00; ">16</span><span style="color:#808030; ">)</span><span style="color:#800080; ">;</span></span>
<span class="line_wrapper">    assert<span style="color:#808030; ">(</span><span style="color:#666616; ">std</span><span style="color:#800080; ">::</span>isnan<span style="color:#808030; ">(</span>result<span style="color:#808030; ">[</span><span style="color:#008c00; ">0</span><span style="color:#808030; ">]</span><span style="color:#808030; ">)</span><span style="color:#808030; ">)</span><span style="color:#800080; ">;</span></span>
<span class="line_wrapper">    assert<span style="color:#808030; ">(</span><span style="color:#603000; ">fabs</span><span style="color:#808030; ">(</span>result<span style="color:#808030; ">[</span><span style="color:#008c00; ">1</span><span style="color:#808030; ">]</span> <span style="color:#808030; ">-</span> <span style="color:#008000; ">0.125</span><span style="color:#808030; ">)</span> <span style="color:#808030; ">&lt;</span> <span style="color:#008000; ">0.001</span><span style="color:#808030; ">)</span><span style="color:#800080; ">;</span></span>
<span class="line_wrapper">    assert<span style="color:#808030; ">(</span><span style="color:#603000; ">fabs</span><span style="color:#808030; ">(</span>result<span style="color:#808030; ">[</span><span style="color:#008c00; ">2</span><span style="color:#808030; ">]</span> <span style="color:#808030; ">-</span> <span style="color:#008000; ">0.0893</span><span style="color:#808030; ">)</span> <span style="color:#808030; ">&lt;</span> <span style="color:#008000; ">0.0001</span><span style="color:#808030; ">)</span><span style="color:#800080; ">;</span></span>
<span class="line_wrapper">    assert<span style="color:#808030; ">(</span><span style="color:#603000; ">fabs</span><span style="color:#808030; ">(</span>result<span style="color:#808030; ">[</span><span style="color:#008c00; ">3</span><span style="color:#808030; ">]</span> <span style="color:#808030; ">-</span> <span style="color:#008000; ">0.0396</span><span style="color:#808030; ">)</span> <span style="color:#808030; ">&lt;</span> <span style="color:#008000; ">0.0001</span><span style="color:#808030; ">)</span><span style="color:#800080; ">;</span></span>
<span class="line_wrapper">    assert<span style="color:#808030; ">(</span><span style="color:#603000; ">fabs</span><span style="color:#808030; ">(</span>result<span style="color:#808030; ">[</span><span style="color:#008c00; ">4</span><span style="color:#808030; ">]</span> <span style="color:#808030; ">-</span> <span style="color:#008000; ">0.1258</span><span style="color:#808030; ">)</span> <span style="color:#808030; ">&lt;</span> <span style="color:#008000; ">0.0001</span><span style="color:#808030; ">)</span><span style="color:#800080; ">;</span></span>
<span class="line_wrapper">    assert<span style="color:#808030; ">(</span><span style="color:#603000; ">fabs</span><span style="color:#808030; ">(</span>result<span style="color:#808030; ">[</span><span style="color:#008c00; ">15</span><span style="color:#808030; ">]</span> <span style="color:#808030; ">-</span> <span style="color:#008000; ">0.0228</span><span style="color:#808030; ">)</span> <span style="color:#808030; ">&lt;</span> <span style="color:#008000; ">0.0001</span><span style="color:#808030; ">)</span><span style="color:#800080; ">;</span></span>
<span class="line_wrapper">    assert<span style="color:#808030; ">(</span><span style="color:#603000; ">fabs</span><span style="color:#808030; ">(</span>result<span style="color:#808030; ">[</span><span style="color:#008c00; ">14</span><span style="color:#808030; ">]</span> <span style="color:#808030; ">-</span> <span style="color:#008000; ">0.0205</span><span style="color:#808030; ">)</span> <span style="color:#808030; ">&lt;</span> <span style="color:#008000; ">0.0001</span><span style="color:#808030; ">)</span><span style="color:#800080; ">;</span></span>
<span class="line_wrapper">    assert<span style="color:#808030; ">(</span><span style="color:#603000; ">fabs</span><span style="color:#808030; ">(</span>result<span style="color:#808030; ">[</span><span style="color:#008c00; ">13</span><span style="color:#808030; ">]</span> <span style="color:#808030; ">-</span> <span style="color:#008000; ">0.0377</span><span style="color:#808030; ">)</span> <span style="color:#808030; ">&lt;</span> <span style="color:#008000; ">0.0001</span><span style="color:#808030; ">)</span><span style="color:#800080; ">;</span></span>
<span class="line_wrapper"><span style="color:#800080; ">}</span></span>
<span class="line_wrapper"></span></pre>

<pre class="code_syntax" style="color:#000000;background:#ffffff00;"><span class="line_wrapper"></span>
<span class="line_wrapper"><span style="color:#696969; ">// -----------------------------------------------------------------------------</span></span>
<span class="line_wrapper"></span>
<span class="line_wrapper"><span style="color:#800000; font-weight:bold; ">static</span> <span style="color:#800000; font-weight:bold; ">void</span> test_ExponentiallyWeightedCovVisitor<span style="color:#808030; ">(</span><span style="color:#808030; ">)</span>  <span style="color:#800080; ">{</span></span>
<span class="line_wrapper"></span>
<span class="line_wrapper">    <span style="color:#666616; ">std</span><span style="color:#800080; ">::</span><span style="color:#603000; ">cout</span> <span style="color:#808030; ">&lt;</span><span style="color:#808030; ">&lt;</span> <span style="color:#800000; ">"</span><span style="color:#0f69ff; ">\n</span><span style="color:#0000e6; ">Testing ExponentiallyWeightedCovVisitor{  } ...</span><span style="color:#800000; ">"</span></span>
<span class="line_wrapper">              <span style="color:#808030; ">&lt;</span><span style="color:#808030; ">&lt;</span> <span style="color:#666616; ">std</span><span style="color:#800080; ">::</span><span style="color:#603000; ">endl</span><span style="color:#800080; ">;</span></span>
<span class="line_wrapper"></span>
<span class="line_wrapper">    StlVecType<span style="color:#800080; ">&lt;</span><span style="color:#800000; font-weight:bold; ">unsigned</span> <span style="color:#800000; font-weight:bold; ">long</span><span style="color:#800080; ">&gt;</span>  idx <span style="color:#808030; ">=</span></span>
<span class="line_wrapper">        <span style="color:#800080; ">{</span> <span style="color:#008c00; ">123450</span><span style="color:#808030; ">,</span> <span style="color:#008c00; ">123451</span><span style="color:#808030; ">,</span> <span style="color:#008c00; ">123452</span><span style="color:#808030; ">,</span> <span style="color:#008c00; ">123453</span><span style="color:#808030; ">,</span> <span style="color:#008c00; ">123454</span><span style="color:#808030; ">,</span> <span style="color:#008c00; ">123455</span><span style="color:#808030; ">,</span> <span style="color:#008c00; ">123456</span><span style="color:#808030; ">,</span></span>
<span class="line_wrapper">          <span style="color:#008c00; ">123457</span><span style="color:#808030; ">,</span> <span style="color:#008c00; ">123458</span><span style="color:#808030; ">,</span> <span style="color:#008c00; ">123459</span><span style="color:#808030; ">,</span> <span style="color:#008c00; ">123460</span><span style="color:#808030; ">,</span> <span style="color:#008c00; ">123461</span><span style="color:#808030; ">,</span> <span style="color:#008c00; ">123462</span><span style="color:#808030; ">,</span> <span style="color:#008c00; ">123466</span><span style="color:#808030; ">,</span> <span style="color:#008c00; ">123467</span><span style="color:#808030; ">,</span> <span style="color:#008c00; ">123468</span> <span style="color:#800080; ">}</span><span style="color:#800080; ">;</span></span>
<span class="line_wrapper">    StlVecType<span style="color:#800080; ">&lt;</span><span style="color:#800000; font-weight:bold; ">double</span><span style="color:#800080; ">&gt;</span>         d1 <span style="color:#808030; ">=</span></span>
<span class="line_wrapper">        <span style="color:#800080; ">{</span> <span style="color:#008000; ">1.0</span><span style="color:#808030; ">,</span> <span style="color:#008000; ">1.5</span><span style="color:#808030; ">,</span> <span style="color:#008000; ">1.0</span><span style="color:#808030; ">,</span> <span style="color:#008000; ">1.2</span><span style="color:#808030; ">,</span> <span style="color:#008000; ">1.7</span><span style="color:#808030; ">,</span> <span style="color:#008000; ">1.5</span><span style="color:#808030; ">,</span> <span style="color:#008000; ">1.2</span><span style="color:#808030; ">,</span> <span style="color:#008000; ">1.7</span><span style="color:#808030; ">,</span> <span style="color:#008000; ">1.7</span><span style="color:#808030; ">,</span> <span style="color:#008000; ">1.3</span><span style="color:#808030; ">,</span> <span style="color:#008000; ">1.4</span><span style="color:#808030; ">,</span> <span style="color:#008000; ">1.5</span><span style="color:#808030; ">,</span> <span style="color:#008000; ">1.2</span><span style="color:#808030; ">,</span> <span style="color:#008000; ">1.1</span><span style="color:#808030; ">,</span> <span style="color:#008000; ">1.15</span><span style="color:#808030; ">,</span> <span style="color:#008000; ">1.0</span> <span style="color:#800080; ">}</span><span style="color:#800080; ">;</span></span>
<span class="line_wrapper">    StlVecType<span style="color:#800080; ">&lt;</span><span style="color:#800000; font-weight:bold; ">double</span><span style="color:#800080; ">&gt;</span>         d2 <span style="color:#808030; ">=</span></span>
<span class="line_wrapper">        <span style="color:#800080; ">{</span> <span style="color:#008000; ">1.5</span><span style="color:#808030; ">,</span> <span style="color:#008000; ">1.0</span><span style="color:#808030; ">,</span> <span style="color:#008000; ">1.1</span><span style="color:#808030; ">,</span> <span style="color:#008000; ">1.3</span><span style="color:#808030; ">,</span> <span style="color:#008000; ">1.35</span><span style="color:#808030; ">,</span> <span style="color:#008000; ">1.2</span><span style="color:#808030; ">,</span> <span style="color:#008000; ">1.2</span><span style="color:#808030; ">,</span> <span style="color:#008000; ">1.6</span><span style="color:#808030; ">,</span> <span style="color:#008000; ">1.6</span><span style="color:#808030; ">,</span> <span style="color:#008000; ">1.8</span><span style="color:#808030; ">,</span> <span style="color:#008000; ">1.4</span><span style="color:#808030; ">,</span> <span style="color:#008000; ">1.5</span><span style="color:#808030; ">,</span> <span style="color:#008000; ">1.25</span><span style="color:#808030; ">,</span> <span style="color:#008000; ">1.3</span><span style="color:#808030; ">,</span> <span style="color:#008000; ">1.25</span><span style="color:#808030; ">,</span> <span style="color:#008000; ">1.0</span> <span style="color:#800080; ">}</span><span style="color:#800080; ">;</span></span>
<span class="line_wrapper">    StlVecType<span style="color:#800080; ">&lt;</span><span style="color:#800000; font-weight:bold; ">int</span><span style="color:#800080; ">&gt;</span>            i1 <span style="color:#808030; ">=</span> <span style="color:#800080; ">{</span> <span style="color:#008c00; ">22</span><span style="color:#808030; ">,</span> <span style="color:#008c00; ">23</span><span style="color:#808030; ">,</span> <span style="color:#008c00; ">24</span><span style="color:#808030; ">,</span> <span style="color:#008c00; ">25</span><span style="color:#808030; ">,</span> <span style="color:#008c00; ">99</span> <span style="color:#800080; ">}</span><span style="color:#800080; ">;</span></span>
<span class="line_wrapper">    MyDataFrame                df<span style="color:#800080; ">;</span></span>
<span class="line_wrapper"></span>
<span class="line_wrapper">    df<span style="color:#808030; ">.</span>load_data<span style="color:#808030; ">(</span><span style="color:#666616; ">std</span><span style="color:#800080; ">::</span><span style="color:#603000; ">move</span><span style="color:#808030; ">(</span>idx<span style="color:#808030; ">)</span><span style="color:#808030; ">,</span></span>
<span class="line_wrapper">                 <span style="color:#666616; ">std</span><span style="color:#800080; ">::</span>make_pair<span style="color:#808030; ">(</span><span style="color:#800000; ">"</span><span style="color:#0000e6; ">X Column</span><span style="color:#800000; ">"</span><span style="color:#808030; ">,</span> d1<span style="color:#808030; ">)</span><span style="color:#808030; ">,</span></span>
<span class="line_wrapper">                 <span style="color:#666616; ">std</span><span style="color:#800080; ">::</span>make_pair<span style="color:#808030; ">(</span><span style="color:#800000; ">"</span><span style="color:#0000e6; ">Y Column</span><span style="color:#800000; ">"</span><span style="color:#808030; ">,</span> d2<span style="color:#808030; ">)</span><span style="color:#808030; ">,</span></span>
<span class="line_wrapper">                 <span style="color:#666616; ">std</span><span style="color:#800080; ">::</span>make_pair<span style="color:#808030; ">(</span><span style="color:#800000; ">"</span><span style="color:#0000e6; ">col_3</span><span style="color:#800000; ">"</span><span style="color:#808030; ">,</span> i1<span style="color:#808030; ">)</span><span style="color:#808030; ">)</span><span style="color:#800080; ">;</span></span>
<span class="line_wrapper"></span>
<span class="line_wrapper">    ewm_cov_v<span style="color:#800080; ">&lt;</span><span style="color:#800000; font-weight:bold; ">double</span><span style="color:#800080; ">&gt;</span>   ewmcov<span style="color:#808030; ">(</span>exponential_decay_spec<span style="color:#800080; ">::</span>span<span style="color:#808030; ">,</span> <span style="color:#008c00; ">3</span><span style="color:#808030; ">)</span><span style="color:#800080; ">;</span></span>
<span class="line_wrapper">    <span style="color:#800000; font-weight:bold; ">const</span> <span style="color:#800000; font-weight:bold; ">auto</span>          <span style="color:#808030; ">&amp;</span>result <span style="color:#808030; ">=</span> df<span style="color:#808030; ">.</span>single_act_visit<span style="color:#800080; ">&lt;</span><span style="color:#800000; font-weight:bold; ">double</span><span style="color:#808030; ">,</span> <span style="color:#800000; font-weight:bold; ">double</span><span style="color:#800080; ">&gt;</span><span style="color:#808030; ">(</span><span style="color:#800000; ">"</span><span style="color:#0000e6; ">X Column</span><span style="color:#800000; ">"</span><span style="color:#808030; ">,</span> <span style="color:#800000; ">"</span><span style="color:#0000e6; ">Y Column</span><span style="color:#800000; ">"</span><span style="color:#808030; ">,</span> ewmcov<span style="color:#808030; ">)</span><span style="color:#808030; ">.</span>get_result<span style="color:#808030; ">(</span><span style="color:#808030; ">)</span><span style="color:#800080; ">;</span></span>
<span class="line_wrapper"></span>
<span class="line_wrapper">    assert<span style="color:#808030; ">(</span>result<span style="color:#808030; ">.</span>size<span style="color:#808030; ">(</span><span style="color:#808030; ">)</span> <span style="color:#808030; ">=</span><span style="color:#808030; ">=</span> <span style="color:#008c00; ">16</span><span style="color:#808030; ">)</span><span style="color:#800080; ">;</span></span>
<span class="line_wrapper">    assert<span style="color:#808030; ">(</span><span style="color:#666616; ">std</span><span style="color:#800080; ">::</span>isnan<span style="color:#808030; ">(</span>result<span style="color:#808030; ">[</span><span style="color:#008c00; ">0</span><span style="color:#808030; ">]</span><span style="color:#808030; ">)</span><span style="color:#808030; ">)</span><span style="color:#800080; ">;</span></span>
<span class="line_wrapper">    assert<span style="color:#808030; ">(</span><span style="color:#603000; ">fabs</span><span style="color:#808030; ">(</span>result<span style="color:#808030; ">[</span><span style="color:#008c00; ">1</span><span style="color:#808030; ">]</span> <span style="color:#808030; ">-</span> <span style="color:#808030; ">-</span><span style="color:#008000; ">0.125</span><span style="color:#808030; ">)</span> <span style="color:#808030; ">&lt;</span> <span style="color:#008000; ">0.001</span><span style="color:#808030; ">)</span><span style="color:#800080; ">;</span></span>
<span class="line_wrapper">    assert<span style="color:#808030; ">(</span><span style="color:#603000; ">fabs</span><span style="color:#808030; ">(</span>result<span style="color:#808030; ">[</span><span style="color:#008c00; ">2</span><span style="color:#808030; ">]</span> <span style="color:#808030; ">-</span> <span style="color:#808030; ">-</span><span style="color:#008000; ">0.0321</span><span style="color:#808030; ">)</span> <span style="color:#808030; ">&lt;</span> <span style="color:#008000; ">0.0001</span><span style="color:#808030; ">)</span><span style="color:#800080; ">;</span></span>
<span class="line_wrapper">    assert<span style="color:#808030; ">(</span><span style="color:#603000; ">fabs</span><span style="color:#808030; ">(</span>result<span style="color:#808030; ">[</span><span style="color:#008c00; ">3</span><span style="color:#808030; ">]</span> <span style="color:#808030; ">-</span> <span style="color:#808030; ">-</span><span style="color:#008000; ">0.0099</span><span style="color:#808030; ">)</span> <span style="color:#808030; ">&lt;</span> <span style="color:#008000; ">0.0001</span><span style="color:#808030; ">)</span><span style="color:#800080; ">;</span></span>
<span class="line_wrapper">    assert<span style="color:#808030; ">(</span><span style="color:#603000; ">fabs</span><span style="color:#808030; ">(</span>result<span style="color:#808030; ">[</span><span style="color:#008c00; ">4</span><span style="color:#808030; ">]</span> <span style="color:#808030; ">-</span> <span style="color:#008000; ">0.0219</span><span style="color:#808030; ">)</span> <span style="color:#808030; ">&lt;</span> <span style="color:#008000; ">0.0001</span><span style="color:#808030; ">)</span><span style="color:#800080; ">;</span></span>
<span class="line_wrapper">    assert<span style="color:#808030; ">(</span><span style="color:#603000; ">fabs</span><span style="color:#808030; ">(</span>result<span style="color:#808030; ">[</span><span style="color:#008c00; ">15</span><span style="color:#808030; ">]</span> <span style="color:#808030; ">-</span> <span style="color:#008000; ">0.0263</span><span style="color:#808030; ">)</span> <span style="color:#808030; ">&lt;</span> <span style="color:#008000; ">0.0001</span><span style="color:#808030; ">)</span><span style="color:#800080; ">;</span></span>
<span class="line_wrapper">    assert<span style="color:#808030; ">(</span><span style="color:#603000; ">fabs</span><span style="color:#808030; ">(</span>result<span style="color:#808030; ">[</span><span style="color:#008c00; ">14</span><span style="color:#808030; ">]</span> <span style="color:#808030; ">-</span> <span style="color:#008000; ">0.0121</span><span style="color:#808030; ">)</span> <span style="color:#808030; ">&lt;</span> <span style="color:#008000; ">0.0001</span><span style="color:#808030; ">)</span><span style="color:#800080; ">;</span></span>
<span class="line_wrapper">    assert<span style="color:#808030; ">(</span><span style="color:#603000; ">fabs</span><span style="color:#808030; ">(</span>result<span style="color:#808030; ">[</span><span style="color:#008c00; ">13</span><span style="color:#808030; ">]</span> <span style="color:#808030; ">-</span> <span style="color:#008000; ">0.0197</span><span style="color:#808030; ">)</span> <span style="color:#808030; ">&lt;</span> <span style="color:#008000; ">0.0001</span><span style="color:#808030; ">)</span><span style="color:#800080; ">;</span></span>
<span class="line_wrapper"><span style="color:#800080; ">}</span></span>
<span class="line_wrapper"></span></pre>

<pre class="code_syntax" style="color:#000000;background:#ffffff00;"><span class="line_wrapper"></span>
<span class="line_wrapper"><span style="color:#696969; ">// -----------------------------------------------------------------------------</span></span>
<span class="line_wrapper"></span>
<span class="line_wrapper"><span style="color:#800000; font-weight:bold; ">static</span> <span style="color:#800000; font-weight:bold; ">void</span> test_ExponentiallyWeightedCorrVisitor<span style="color:#808030; ">(</span><span style="color:#808030; ">)</span>  <span style="color:#800080; ">{</span></span>
<span class="line_wrapper"></span>
<span class="line_wrapper">    <span style="color:#666616; ">std</span><span style="color:#800080; ">::</span><span style="color:#603000; ">cout</span> <span style="color:#808030; ">&lt;</span><span style="color:#808030; ">&lt;</span> <span style="color:#800000; ">"</span><span style="color:#0f69ff; ">\n</span><span style="color:#0000e6; ">Testing ExponentiallyWeightedCorrVisitor{  } ...</span><span style="color:#800000; ">"</span></span>
<span class="line_wrapper">              <span style="color:#808030; ">&lt;</span><span style="color:#808030; ">&lt;</span> <span style="color:#666616; ">std</span><span style="color:#800080; ">::</span><span style="color:#603000; ">endl</span><span style="color:#800080; ">;</span></span>
<span class="line_wrapper"></span>
<span class="line_wrapper">    StlVecType<span style="color:#800080; ">&lt;</span><span style="color:#800000; font-weight:bold; ">unsigned</span> <span style="color:#800000; font-weight:bold; ">long</span><span style="color:#800080; ">&gt;</span>  idx <span style="color:#808030; ">=</span></span>
<span class="line_wrapper">        <span style="color:#800080; ">{</span> <span style="color:#008c00; ">123450</span><span style="color:#808030; ">,</span> <span style="color:#008c00; ">123451</span><span style="color:#808030; ">,</span> <span style="color:#008c00; ">123452</span><span style="color:#808030; ">,</span> <span style="color:#008c00; ">123453</span><span style="color:#808030; ">,</span> <span style="color:#008c00; ">123454</span><span style="color:#808030; ">,</span> <span style="color:#008c00; ">123455</span><span style="color:#808030; ">,</span> <span style="color:#008c00; ">123456</span><span style="color:#808030; ">,</span></span>
<span class="line_wrapper">          <span style="color:#008c00; ">123457</span><span style="color:#808030; ">,</span> <span style="color:#008c00; ">123458</span><span style="color:#808030; ">,</span> <span style="color:#008c00; ">123459</span><span style="color:#808030; ">,</span> <span style="color:#008c00; ">123460</span><span style="color:#808030; ">,</span> <span style="color:#008c00; ">123461</span><span style="color:#808030; ">,</span> <span style="color:#008c00; ">123462</span><span style="color:#808030; ">,</span> <span style="color:#008c00; ">123466</span><span style="color:#808030; ">,</span> <span style="color:#008c00; ">123467</span><span style="color:#808030; ">,</span> <span style="color:#008c00; ">123468</span> <span style="color:#800080; ">}</span><span style="color:#800080; ">;</span></span>
<span class="line_wrapper">    StlVecType<span style="color:#800080; ">&lt;</span><span style="color:#800000; font-weight:bold; ">double</span><span style="color:#800080; ">&gt;</span>         d1 <span style="color:#808030; ">=</span></span>
<span class="line_wrapper">        <span style="color:#800080; ">{</span> <span style="color:#008000; ">1.0</span><span style="color:#808030; ">,</span> <span style="color:#008000; ">1.5</span><span style="color:#808030; ">,</span> <span style="color:#008000; ">1.0</span><span style="color:#808030; ">,</span> <span style="color:#008000; ">1.2</span><span style="color:#808030; ">,</span> <span style="color:#008000; ">1.7</span><span style="color:#808030; ">,</span> <span style="color:#008000; ">1.5</span><span style="color:#808030; ">,</span> <span style="color:#008000; ">1.2</span><span style="color:#808030; ">,</span> <span style="color:#008000; ">1.7</span><span style="color:#808030; ">,</span> <span style="color:#008000; ">1.7</span><span style="color:#808030; ">,</span> <span style="color:#008000; ">1.3</span><span style="color:#808030; ">,</span> <span style="color:#008000; ">1.4</span><span style="color:#808030; ">,</span> <span style="color:#008000; ">1.5</span><span style="color:#808030; ">,</span> <span style="color:#008000; ">1.2</span><span style="color:#808030; ">,</span> <span style="color:#008000; ">1.1</span><span style="color:#808030; ">,</span> <span style="color:#008000; ">1.15</span><span style="color:#808030; ">,</span> <span style="color:#008000; ">1.0</span> <span style="color:#800080; ">}</span><span style="color:#800080; ">;</span></span>
<span class="line_wrapper">    StlVecType<span style="color:#800080; ">&lt;</span><span style="color:#800000; font-weight:bold; ">double</span><span style="color:#800080; ">&gt;</span>         d2 <span style="color:#808030; ">=</span></span>
<span class="line_wrapper">        <span style="color:#800080; ">{</span> <span style="color:#008000; ">1.5</span><span style="color:#808030; ">,</span> <span style="color:#008000; ">1.0</span><span style="color:#808030; ">,</span> <span style="color:#008000; ">1.1</span><span style="color:#808030; ">,</span> <span style="color:#008000; ">1.3</span><span style="color:#808030; ">,</span> <span style="color:#008000; ">1.35</span><span style="color:#808030; ">,</span> <span style="color:#008000; ">1.2</span><span style="color:#808030; ">,</span> <span style="color:#008000; ">1.2</span><span style="color:#808030; ">,</span> <span style="color:#008000; ">1.6</span><span style="color:#808030; ">,</span> <span style="color:#008000; ">1.6</span><span style="color:#808030; ">,</span> <span style="color:#008000; ">1.8</span><span style="color:#808030; ">,</span> <span style="color:#008000; ">1.4</span><span style="color:#808030; ">,</span> <span style="color:#008000; ">1.5</span><span style="color:#808030; ">,</span> <span style="color:#008000; ">1.25</span><span style="color:#808030; ">,</span> <span style="color:#008000; ">1.3</span><span style="color:#808030; ">,</span> <span style="color:#008000; ">1.25</span><span style="color:#808030; ">,</span> <span style="color:#008000; ">1.0</span> <span style="color:#800080; ">}</span><span style="color:#800080; ">;</span></span>
<span class="line_wrapper">    StlVecType<span style="color:#800080; ">&lt;</span><span style="color:#800000; font-weight:bold; ">int</span><span style="color:#800080; ">&gt;</span>            i1 <span style="color:#808030; ">=</span> <span style="color:#800080; ">{</span> <span style="color:#008c00; ">22</span><span style="color:#808030; ">,</span> <span style="color:#008c00; ">23</span><span style="color:#808030; ">,</span> <span style="color:#008c00; ">24</span><span style="color:#808030; ">,</span> <span style="color:#008c00; ">25</span><span style="color:#808030; ">,</span> <span style="color:#008c00; ">99</span> <span style="color:#800080; ">}</span><span style="color:#800080; ">;</span></span>
<span class="line_wrapper">    MyDataFrame                df<span style="color:#800080; ">;</span></span>
<span class="line_wrapper"></span>
<span class="line_wrapper">    df<span style="color:#808030; ">.</span>load_data<span style="color:#808030; ">(</span><span style="color:#666616; ">std</span><span style="color:#800080; ">::</span><span style="color:#603000; ">move</span><span style="color:#808030; ">(</span>idx<span style="color:#808030; ">)</span><span style="color:#808030; ">,</span></span>
<span class="line_wrapper">                 <span style="color:#666616; ">std</span><span style="color:#800080; ">::</span>make_pair<span style="color:#808030; ">(</span><span style="color:#800000; ">"</span><span style="color:#0000e6; ">X Column</span><span style="color:#800000; ">"</span><span style="color:#808030; ">,</span> d1<span style="color:#808030; ">)</span><span style="color:#808030; ">,</span></span>
<span class="line_wrapper">                 <span style="color:#666616; ">std</span><span style="color:#800080; ">::</span>make_pair<span style="color:#808030; ">(</span><span style="color:#800000; ">"</span><span style="color:#0000e6; ">Y Column</span><span style="color:#800000; ">"</span><span style="color:#808030; ">,</span> d2<span style="color:#808030; ">)</span><span style="color:#808030; ">,</span></span>
<span class="line_wrapper">                 <span style="color:#666616; ">std</span><span style="color:#800080; ">::</span>make_pair<span style="color:#808030; ">(</span><span style="color:#800000; ">"</span><span style="color:#0000e6; ">col_3</span><span style="color:#800000; ">"</span><span style="color:#808030; ">,</span> i1<span style="color:#808030; ">)</span><span style="color:#808030; ">)</span><span style="color:#800080; ">;</span></span>
<span class="line_wrapper"></span>
<span class="line_wrapper">    ewm_corr_v<span style="color:#800080; ">&lt;</span><span style="color:#800000; font-weight:bold; ">double</span><span style="color:#800080; ">&gt;</span>  ewmcorr<span style="color:#808030; ">(</span>exponential_decay_spec<span style="color:#800080; ">::</span>span<span style="color:#808030; ">,</span> <span style="color:#008c00; ">3</span><span style="color:#808030; ">)</span><span style="color:#800080; ">;</span></span>
<span class="line_wrapper">    <span style="color:#800000; font-weight:bold; ">const</span> <span style="color:#800000; font-weight:bold; ">auto</span>          <span style="color:#808030; ">&amp;</span>result <span style="color:#808030; ">=</span> df<span style="color:#808030; ">.</span>single_act_visit<span style="color:#800080; ">&lt;</span><span style="color:#800000; font-weight:bold; ">double</span><span style="color:#808030; ">,</span> <span style="color:#800000; font-weight:bold; ">double</span><span style="color:#800080; ">&gt;</span><span style="color:#808030; ">(</span><span style="color:#800000; ">"</span><span style="color:#0000e6; ">X Column</span><span style="color:#800000; ">"</span><span style="color:#808030; ">,</span> <span style="color:#800000; ">"</span><span style="color:#0000e6; ">Y Column</span><span style="color:#800000; ">"</span><span style="color:#808030; ">,</span> ewmcorr<span style="color:#808030; ">)</span><span style="color:#808030; ">.</span>get_result<span style="color:#808030; ">(</span><span style="color:#808030; ">)</span><span style="color:#800080; ">;</span></span>
<span class="line_wrapper"></span>
<span class="line_wrapper">    assert<span style="color:#808030; ">(</span>result<span style="color:#808030; ">.</span>size<span style="color:#808030; ">(</span><span style="color:#808030; ">)</span> <span style="color:#808030; ">=</span><span style="color:#808030; ">=</span> <span style="color:#008c00; ">16</span><span style="color:#808030; ">)</span><span style="color:#800080; ">;</span></span>
<span class="line_wrapper">    assert<span style="color:#808030; ">(</span><span style="color:#666616; ">std</span><span style="color:#800080; ">::</span>isnan<span style="color:#808030; ">(</span>result<span style="color:#808030; ">[</span><span style="color:#008c00; ">0</span><span style="color:#808030; ">]</span><span style="color:#808030; ">)</span><span style="color:#808030; ">)</span><span style="color:#800080; ">;</span></span>
<span class="line_wrapper">    assert<span style="color:#808030; ">(</span><span style="color:#603000; ">fabs</span><span style="color:#808030; ">(</span>result<span style="color:#808030; ">[</span><span style="color:#008c00; ">1</span><span style="color:#808030; ">]</span> <span style="color:#808030; ">-</span> <span style="color:#808030; ">-</span><span style="color:#008000; ">1.0</span><span style="color:#808030; ">)</span> <span style="color:#808030; ">&lt;</span> <span style="color:#008000; ">0.001</span><span style="color:#808030; ">)</span><span style="color:#800080; ">;</span></span>
<span class="line_wrapper">    assert<span style="color:#808030; ">(</span><span style="color:#603000; ">fabs</span><span style="color:#808030; ">(</span>result<span style="color:#808030; ">[</span><span style="color:#008c00; ">2</span><span style="color:#808030; ">]</span> <span style="color:#808030; ">-</span> <span style="color:#808030; ">-</span><span style="color:#008000; ">0.5153</span><span style="color:#808030; ">)</span> <span style="color:#808030; ">&lt;</span> <span style="color:#008000; ">0.0001</span><span style="color:#808030; ">)</span><span style="color:#800080; ">;</span></span>
<span class="line_wrapper">    assert<span style="color:#808030; ">(</span><span style="color:#603000; ">fabs</span><span style="color:#808030; ">(</span>result<span style="color:#808030; ">[</span><span style="color:#008c00; ">3</span><span style="color:#808030; ">]</span> <span style="color:#808030; ">-</span> <span style="color:#808030; ">-</span><span style="color:#008000; ">0.2841</span><span style="color:#808030; ">)</span> <span style="color:#808030; ">&lt;</span> <span style="color:#008000; ">0.0001</span><span style="color:#808030; ">)</span><span style="color:#800080; ">;</span></span>
<span class="line_wrapper">    assert<span style="color:#808030; ">(</span><span style="color:#603000; ">fabs</span><span style="color:#808030; ">(</span>result<span style="color:#808030; ">[</span><span style="color:#008c00; ">4</span><span style="color:#808030; ">]</span> <span style="color:#808030; ">-</span> <span style="color:#008000; ">0.4287</span><span style="color:#808030; ">)</span> <span style="color:#808030; ">&lt;</span> <span style="color:#008000; ">0.0001</span><span style="color:#808030; ">)</span><span style="color:#800080; ">;</span></span>
<span class="line_wrapper">    assert<span style="color:#808030; ">(</span><span style="color:#603000; ">fabs</span><span style="color:#808030; ">(</span>result<span style="color:#808030; ">[</span><span style="color:#008c00; ">15</span><span style="color:#808030; ">]</span> <span style="color:#808030; ">-</span> <span style="color:#008000; ">0.8746</span><span style="color:#808030; ">)</span> <span style="color:#808030; ">&lt;</span> <span style="color:#008000; ">0.0001</span><span style="color:#808030; ">)</span><span style="color:#800080; ">;</span></span>
<span class="line_wrapper">    assert<span style="color:#808030; ">(</span><span style="color:#603000; ">fabs</span><span style="color:#808030; ">(</span>result<span style="color:#808030; ">[</span><span style="color:#008c00; ">14</span><span style="color:#808030; ">]</span> <span style="color:#808030; ">-</span> <span style="color:#008000; ">0.714</span><span style="color:#808030; ">)</span> <span style="color:#808030; ">&lt;</span> <span style="color:#008000; ">0.0001</span><span style="color:#808030; ">)</span><span style="color:#800080; ">;</span></span>
<span class="line_wrapper">    assert<span style="color:#808030; ">(</span><span style="color:#603000; ">fabs</span><span style="color:#808030; ">(</span>result<span style="color:#808030; ">[</span><span style="color:#008c00; ">13</span><span style="color:#808030; ">]</span> <span style="color:#808030; ">-</span> <span style="color:#008000; ">0.6865</span><span style="color:#808030; ">)</span> <span style="color:#808030; ">&lt;</span> <span style="color:#008000; ">0.0001</span><span style="color:#808030; ">)</span><span style="color:#800080; ">;</span></span>
<span class="line_wrapper"><span style="color:#800080; ">}</span></span>
<span class="line_wrapper"></span></pre>

  <BR><img src="https://github.com/hosseinmoein/DataFrame/blob/master/docs/LionLookingUp.jpg?raw=true" alt="C++ DataFrame"
       width="200" height="200" style="float:right"/>

</body>
</html>

<!--
Local Variables:
mode:HTML
tab-width:4
c-basic-offset:4
End:
-->
